In any information retrieval system, one key component is how to measure the similarity of a query object and objects to retrieve. Although pre-defined metrics are widely used, metrics learned from data have received more and more attention because such metrics are able to adapt to specific properties of the data of interest, resulting in higher retrieval accuracy.